package study;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import study.feign.MyFeignClient;

/**
 */
@RestController
@RefreshScope
public class HelloController {

    //autoRefreshed 表示自动刷新
    @Value(value = "${key:hello world}")
    private String name;

    @Value(value = "${config.env:22222}")
    private String env;
    @Value(value = "${config.flag:22222}")
    private String common_flag;
    @GetMapping("/say")
    public String sayHello(){
        return "say："+name+"  config.env:"+env+" common_flag:"+common_flag;
    }
    @Autowired
    MyFeignClient myFeignClient;
    @GetMapping("/hello")
    public String hello(){
        return myFeignClient.hello();

    }

}
